package tomsung.cloud.agdc.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import tomsung.cloud.agdc.bean.GreenHouse;
import tomsung.cloud.agdc.dao.GreenHouseMapper;

@Service("GreenHouseService")
public class GreenHouseService {

	@Autowired
	GreenHouseMapper greenHouseMapper;
	
	public int createGreenHouse(GreenHouse record)
	{
		return greenHouseMapper.insertSelective(record);
	}
	
	public int deleteGreenHouse(Integer greenhouseId)
	{
		return greenHouseMapper.deleteByPrimaryKey(greenhouseId);
	}
	
	public GreenHouse selectGreenHouse(Integer greenhouseId)
	{
		return greenHouseMapper.selectByPrimaryKey(greenhouseId);
	}
	
	public int updateGreenHouse(GreenHouse record)
	{
		return greenHouseMapper.updateByPrimaryKey(record);
	}
	
	public List<GreenHouse> getGreenHouseDataByAdd(Integer province, Integer city, Integer district)
	{
		return greenHouseMapper.getGreenHouseDataByAdd(province, city, district);
	}

	public List<GreenHouse> selectGreenHouseByIds(List<Integer> greenhouseIds) {
		return greenHouseMapper.selectGreenHouseByIds(greenhouseIds);
		
	}

	public List<String> getAdministrator(Integer greenhouseIds){
		return greenHouseMapper.getAdministrator(greenhouseIds);
	}

	public List<GreenHouse> selectALLGreenHouse() {
		return greenHouseMapper.selectALLGreenHouse();
	}
}
